<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:comp="http://facelets.mycomponents.com">
<h:head>
    <title>ScrumApp</title>
    <link type="text/css" rel="stylesheet" href="resources/css/style.css" />
    <link type="text/css" rel="stylesheet" href="resources/css/theme.css"/>
    <link type="text/css" rel="stylesheet" href="resources/css/primefacesSkin.css"/>
    <script type="JavaScript" src="scripts/handleDialogComplete.js"></script>
</h:head>

<h:body>
    <f:view locale="#{Language.locale}">
        <f:loadBundle basename="resources.messages.Messages" var="msgBundle"/>
        <div id="container">
            <div id="header">
                <h2>ScrumApp</h2>
                <div id="topmenu">
                    <ul>
                        <li><a href="/ScrumApp/faces/Project.xhtml">#{msgBundle.project}</a></li>
                        <li><a href="/ScrumApp/faces/ProductBacklog.xhtml">#{msgBundle.product_backlog}</a></li>
                        <li><a href="/ScrumApp/faces/SprintBacklog.xhtml">#{msgBundle.sprint_backlog}</a></li>
                        <li class="current"><a href="/ScrumApp/faces/SprintList.xhtml">#{msgBundle.sprint_list}</a></li>
                        <li><a href="/ScrumApp/faces/Impediments.xhtml">#{msgBundle.impediments}</a></li>
                        <li><a href="/ScrumApp/faces/People.xhtml">#{msgBundle.people}</a></li>
                        <li><a href="/ScrumApp/faces/Charts.xhtml">#{msgBundle.charts}</a></li>
                        <li><a href="/ScrumApp/faces/Taskboard.xhtml">Task Board</a></li>
                    </ul>
                </div>
            </div>
            <div id="top-panel">
                <h:form id="frmBack" styleClass="form" >
                    <a style="margin-left: 10px;" href="/ScrumApp/faces/SprintList.xhtml">
                        <h:outputText style="font-weight: bold" value="← #{msgBundle.back}"/>
                    </a>
                    <a style="margin-left: 180px;" href="/ScrumApp/faces/SprintList.xhtml">#{msgBundle.sprint_list}</a>
                    <h:outputText style="font-weight: bold" value=" → #{msgBundle.plan_sprint}"/>
                    <comp:chooseLanguage/>
                </h:form>
            </div>

            <div id="content">

                <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>

                <p:dialog modal="true" widgetVar="statusDialog" header="Status"
                        draggable="false" closable="false">
                    <p:graphicImage value="images/ajax-loader.gif" />
                </p:dialog>

                <h:form prependId="false" styleClass="form">
                    <div class="extendedbox" align="center" >
                        <h3>
                            <h:outputText value="#{msgBundle.plan_sprint}" />
                        </h3>
                        <br/>
                        <table width="95%" class="dataTable" >
                            <tr align="center" class="header">
                                <td style="width: 45px" >#{msgBundle.number}</td>
                                <td>#{msgBundle.objective}</td>
                                <td style="width: 100px" >#{msgBundle.start_date}</td>
                                <td style="width: 100px" >#{msgBundle.end_date}</td>
                            </tr>
                            <tr align="center">
                                <td>#{plansprintBean.sprint.sprintNumber}</td>
                                <td>#{plansprintBean.sprint.objective}</td>
                                <td><h:outputText value="#{plansprintBean.sprint.start}" converter="CustomDateTimeConverter">
                                    </h:outputText></td>
                                <td><h:outputText value="#{plansprintBean.sprint.end}" converter="CustomDateTimeConverter">
                                    </h:outputText></td>
                            </tr>
                        </table>
                        <br/>
                        <br/>

                        <p:pickList value="#{plansprintBean.picklist}" var="list" itemLabel="#{list.description}"
                                    itemValue="#{list}" converter="ProductConverter" >
                            <f:facet name="sourceCaption">#{msgBundle.product_backlog}</f:facet>
                            <f:facet name="targetCaption">#{msgBundle.sprint_backlog}</f:facet>

                        </p:pickList>

                        <p:commandButton value="#{msgBundle.submit}" style=" margin-top: 10px; font-weight: bold"
                                         action="#{plansprintBean.submitSave}" />

                        <br/>
                        <br/>
                    </div>
                </h:form>
            </div>
            <div id="footer">
                <div id="credits">Template based on another by <a href="http://www.bloganje.com">Bloganje</a>
                </div>
                <br />
            </div>
        </div>
    </f:view>
</h:body>
</html>
